package net.ikenway.springboot.demo.Model.Dto;

import com.google.gson.annotations.SerializedName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import net.ikenway.springboot.demo.Model.Entity.Address;
import net.ikenway.springboot.demo.Model.Entity.Order;
import net.ikenway.springboot.demo.Model.Entity.OrderSub;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
import java.sql.Timestamp;
import java.util.List;

/**
 * @author MasterKenway <zk@ikenway.net>
 * @Description
 * @date Created Date 12/17/2020
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class OrderDto implements Serializable {
    private Long orderId;

    private BigDecimal totalPrice;

    private Timestamp createTime;

    private Timestamp purchaseTime;

    private Order.Type type;

    private Order.Status status;

    private Long addressId;

    private Long userId;

    @NotNull(message = "商品不能为空")
    @NotEmpty(message = "商品不能为空")
    @SerializedName(value = "orderSubs")
    private List<OrderSubDto> orderSubDtos;
}
